package com.dengcj.ecology.request.commonaction;

import weaver.workflow.webservices.WorkflowRequestInfo;
import weaver.workflow.webservices.WorkflowServiceImpl;

/**
 * @author dengchunjie
 * @Description: 自动提交流程
 * @date 2022/3/16 19:33
 */
public class AutoSubmitThread extends Thread {

    private int requestId;

    private int operator;

    public AutoSubmitThread(int requestId, int operator){
        this.requestId = requestId;
        this.operator = operator;
    }


    public void run(){
        try {
            Thread.currentThread().sleep(10000);//延时10秒
        } catch(Exception e){
            e.printStackTrace();
        }
        WorkflowServiceImpl wfService = new WorkflowServiceImpl();

        WorkflowRequestInfo workflowRequestInfo= new WorkflowRequestInfo();
        workflowRequestInfo.setRequestId(requestId+"");

        String result = wfService.submitWorkflowRequest(workflowRequestInfo, requestId, operator, "submit",  "系统自动提交");

        if(!"success".equals(result)){

        }
    }
}
